package city.spring.modules.work.action.handler;

import city.spring.modules.work.action.model.AbstractPlanUser;
import city.spring.modules.work.action.model.ResultItem;
import com.google.common.collect.Table;

import java.time.LocalDate;

/**
 * 当天当前班次是否存在该人员
 *
 * @author HouKunLin
 * @date 2020/6/5 0005 13:59
 */
public class TodayShiftHasPeopleHandler<SHIFT, USER> implements IHandler<SHIFT, USER> {
    @Override
    public boolean run(Table<LocalDate, Object, ResultItem<SHIFT, USER>> resultTable, LocalDate rowKey, Object colKey, AbstractPlanUser<USER> people) {
        ResultItem<SHIFT, USER> item = resultTable.get(rowKey, colKey);
        return item.getUsers().contains(people);
    }
}
